<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateComboOrdersTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('combo_orders', function(Blueprint $table)
		{
			$table->increments('id');
			$table->integer('combo_id')->unsigned()->nullable()->index('combo_id')->comment('套餐id');
			$table->integer('activity_id')->unsigned()->nullable()->index('activity_id')->comment('活动id');
			$table->integer('member_id')->unsigned()->nullable()->index('member_id');
			$table->decimal('price', 9)->nullable()->index('price')->comment('支付价格，不是套餐价格和活动价格，为最终的支付价格。');
			$table->timestamps();
			$table->softDeletes();
			$table->string('outTradeNo', 100)->nullable()->default('0');
			$table->decimal('combo_price', 9)->nullable()->comment('原始价格');
			$table->integer('times')->nullable()->comment('景点次数');
			$table->string('thumb', 200)->nullable()->comment('套餐图片');
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('combo_orders');
	}

}
